package com.tomcov.client.view;

import com.extjs.gxt.ui.client.widget.form.TextField;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.ListBox;

public class SettingsViewImpl extends Composite implements SettingsView{

	@SuppressWarnings("unused")
	private Presenter presenter;
	private static final MyUiBinder binder = GWT.create(MyUiBinder.class);
	interface MyUiBinder extends UiBinder<AbsolutePanel, SettingsViewImpl> {
	}
	
	@UiField TextField<String> phone,FirstName,LastName,Age,MarkBox,ModelBox,ConsommationBox,EmailAdress,Password;
	@UiField ListBox placeBox,langageList;
	@UiField Button confirmchange;
	
	public SettingsViewImpl(){
		initWidget(binder.createAndBindUi(this));
	}
	
	@Override
	public void setPresenter(Presenter presenter) {
		this.presenter=presenter;
	}
	
	public TextField<String> getPassword(){
		return Password;
	}
	
	public String getLangage(){
		return langageList.getItemText(langageList.getSelectedIndex());
	}
	
	public int getplace(){
		return Integer.parseInt(placeBox.getItemText(placeBox.getSelectedIndex()));
	}
	
	public TextField<String> getEmailAdress(){
		return EmailAdress;
	}
	
	public TextField<String> getConsommation(){
		return ConsommationBox;
	}
	
	public TextField<String> getModel(){
		return ModelBox;
	}
	
	public TextField<String> getMark(){
		return MarkBox;
	}
	
	public TextField<String> getAge(){
		return Age;
	}
	
	public TextField<String> getLastName(){
		return LastName;
	}
	
	public TextField<String> getFirstName(){
		return FirstName;
	}
	
	public TextField<String> getPhone(){
		return phone;
	}
	
	public Button getConfirmChange(){
		return confirmchange;
	}
	


}
